home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / CLOBSH.PAK / ASSOC.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  102 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  ASSOC.H                                                               */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991, 1993                            */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( __ASSOC_H )
  11. #define __ASSOC_H
  12.  
  13. #define BI_OLDNAMES
  14.  
  15. #if !defined( __CLSTYPES_H )
  16. #include "classlib\obsolete\ClsTypes.h"
  17. #endif  // __CLSTYPES_H
  18.  
  19. #if !defined( __OBJECT_H )
  20. #include "classlib\obsolete\Object.h"
  21. #endif  // __OBJECT_H
  22.  
  23. #if !defined( __SHDDEL_H )
  24. #include "classlib\ShdDel.h"
  25. #endif  // __SHDDEL_H
  26.  
  27. #pragma option -Vo-
  28. #if defined( __BCOPT__ ) && !defined( __FLAT__ ) && !defined( _ALLOW_po )
  29. #pragma option -po-
  30. #endif
  31.  
  32. _CLASSDEF(ostream)
  33. _CLASSDEF(Association)
  34.  
  35. class _CLASSTYPE Association :
  36.     public Object,
  37.     public virtual Object::TShouldDelete
  38. {
  39.  
  40. public:
  41.  
  42.     Association( Object _FAR & k, Object _FAR & v ) :
  43.         aKey( k ),
  44.         aValue( v )
  45.         {
  46.         }
  47.  
  48.     Association( const Association _FAR & a ) :
  49.         aKey(a.aKey),
  50.         aValue(a.aValue)
  51.         {
  52.         }
  53.  
  54.     virtual ~Association();
  55.  
  56.     Object _FAR & key() const
  57.         {
  58.         return aKey;
  59.         }
  60.  
  61.     Object _FAR & value() const
  62.         {
  63.         return aValue;
  64.         }
  65.  
  66.     virtual classType isA() const
  67.         {
  68.         return associationClass;
  69.         }
  70.  
  71.     virtual _TCHAR _FAR *nameOf() const
  72.         {
  73.         return "Association";
  74.         }
  75.  
  76.     virtual hashValueType hashValue() const
  77.         {
  78.         return aKey.hashValue();
  79.         }
  80.  
  81.     virtual int isEqual( const Object _FAR & ) const;
  82.     virtual int isAssociation() const
  83.         {
  84.         return 1;
  85.         }
  86.  
  87.     virtual void printOn( ostream _FAR & ) const;
  88.  
  89. private:
  90.  
  91.     Object _FAR & aKey;
  92.     Object _FAR & aValue;
  93.  
  94. };
  95.  
  96. #if defined( __BCOPT__ ) && !defined( __FLAT__ ) && !defined( _ALLOW_po )
  97. #pragma option -po.
  98. #endif
  99. #pragma option -Vo.
  100.  
  101. #endif
  102.